<?php

use yii\db\Migration;

class m161026_093033_create_taianapply extends Migration
{
    public function safeUp()
    {
        $this->createTable('{{%taianapply}}', [
            'id'=> $this->primaryKey() . ' COMMENT \'自动编号\'',
            'telephone' => $this->string(255)->defaultValue(NULL) . ' COMMENT \'手机号码\'',
            'student_name' => $this->string(255)->defaultValue(NULL) . ' COMMENT \'学员姓名\'',
            'borth_year' => $this->string(255)->defaultValue(NULL) . ' COMMENT \'出生年份\'',
            'borth_month' => $this->string(255)->defaultValue(NULL) . ' COMMENT \'出生月份\'',
            'primary_classification_id' => $this->integer(11)->defaultValue(0) . ' COMMENT \'一级分类\'',
            'secondary_classification_id' => $this->integer(11)->defaultValue(0). ' COMMENT \'二级分类\'',
            'status' => $this->smallInteger(1)->defaultValue(0). ' COMMENT \'状态\'',
            'created_at' => $this->integer(11)->defaultValue(0). ' COMMENT \'创建时间\'',
            'updated_at' => $this->integer(11)->defaultValue(0). ' COMMENT \'更新时间\'',
            'remarks' => $this->text() . ' default NULL COMMENT \'备注\'',
        ]);
    }

    public function safeDown()
    {
        $this->dropTable('{{%taianapply}}');
    }
}
